package com.cyx.nutz.bus.module;

import com.cyx.nutz.sys.filter.TestFilter;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.By;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.Ok;

import javax.servlet.http.HttpSession;

/**
 * Created by Alan on 15/9/7.
 */
@IocBean
@Filters({ @By(type =TestFilter.class) })
public class HelloModule {
    private static final Log log = Logs.get();

    @At("/")
    @Ok("vm:index")
    public Object hello(HttpSession session) {
        return "hello world";
    }

    @At("/login")
    @Ok("vm:template.login")
    public void login() {
        log.debug("hello");
        log.debug("world");
    }

}
